package com.muchfish.reactor.api;

import reactor.core.publisher.Flux;

public class ReactorMapExample {
    public static void main(String[] args) {
        Flux<Integer> source = Flux.range(1, 5);

        // 对每个元素进行平方操作
        Flux<Integer> squared = source.map(x -> x * x);

        squared.subscribe(System.out::println); // 输出: 1, 4, 9, 16, 25
    }
}

